# $Id$
# Maintainer:
# Contributor: Angel Velasquez <angvp@archlinux.org> 
# Contributor: Jason Chu <jason@archlinux.org>
# Contributor: Juergen Hoetzel <jason@archlinux.org>

pkgname=kismet
pkgver=2016_07_R1
_realver="${pkgver//_/-}"
pkgrel=1
pkgdesc="802.11 layer2 wireless network detector, sniffer, and intrusion detection system"
arch=('i686' 'x86_64')
url="https://www.kismetwireless.net/"
license=('GPL')
depends=('libpcap' 'pcre' 'bluez-libs' 'libcap')
optdepends=('gpsd: log coordinates of detected networks'
            'wireshark-cli: provide OUI files used to determine device manufacturer'
            'wireshark-cli: mergecap, to merge multiple capture files'
            'sox: provide the default kismet sound playback binary'
            'festival: text-to-speech support'
            'flite:  alternative/lightweight text-to-speech support'
            'ruby: ruby interface')
backup=('etc/kismet.conf' 'etc/kismet_drone.conf')
install=kismet.install
source=("https://www.kismetwireless.net/code/${pkgname}-${_realver}.tar.xz")
sha256sums=('bdb21f153311f1ff3b16621bf0d6740f66369bf0982b0a289c9a12af8847e237')
validpgpkeys=('354689DF3C9DED803381A661D7B28822738BBDB1') # Michael Kershaw

build() {
    cd ${pkgname}-${_realver}

    ./configure --prefix=/usr \
                --sysconfdir=/etc \
                --localstatedir=/var
    make dep all plugins
}

package() {
    cd ${pkgname}-${_realver}
    make DESTDIR="$pkgdir" install plugins-install
    install -o root -g 315 -m 4550 kismet_capture "${pkgdir}/usr/bin/"

    # the README is very comprehensive, a good idea to include it
    install -Dm 644 README "$pkgdir/usr/share/doc/$pkgname/README"
}
